﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XPressify.Data;
using XPressify.Data.CompliedQueries;

namespace XPressify.Controllers
{
    public class BaseSubjectController : SubjectController
    {
        //USED IN AlbumDetails
        public ActionResult BaseSubjectDetails(Guid id)
        {
            var repo = Repository;
            if(EventCompiledQueries.IsEvent(repo as Repository, id))
            {
                return RedirectToAction("EventDetails", "Event", new {id = id});
            }
            else if (GroupCompiledQueries.IsGroup(repo as Repository, id))
            {
                return RedirectToAction("GroupDetails", "Group", new { id = id });
            }
            else if (PageCompiledQueries.IsPage(repo as Repository, id))
            {
                return RedirectToAction("PageDetails", "Page", new { id = id });
            }
            else
            {
                return RedirectToAction("ProfileView", "Profile", new { id = id });
            }
            return View();
        }


        #region SubjectController functions

        public override ActionResult ConfirmRelationshipNotification(Relationship relationship)
        {
            throw new NotImplementedException();
        }

        public override ActionResult PostponeRelationshipNotification(Relationship relationship)
        {
            throw new NotImplementedException();
        }

        public override ActionResult PostponeFailedRelationshipNotification(Relationship relationship)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
